﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using PSE.Updater.Common.Gateway.DataContract;
using System.Globalization;

namespace PSE.Updater.Client.UI.Converters
{
    [ValueConversion(typeof(PackageStatus), typeof(string))]
    public class PackageStatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            PackageStatus status = (PackageStatus)value;

            switch (status)
            {
                case PackageStatus.Valid:
                    return "Válido";
                case PackageStatus.Missing:
                    return "Não encontrado";
                case PackageStatus.Invalid:
                    return "Inválido";
                case PackageStatus.Installed:
                    return "Instalado";
                default:
                    return "Status não Identificado";
            }
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}

